package com.example.time_bank_demo.exception;


/**
 * 自定义异常 用于抛出业务异常
 *
 * 编译时异常
 * 运行时异常
 */
public class TimeBankException extends RuntimeException{

    private int code;
    private String message;

    public TimeBankException(int code, String message) {
        this.code = code;
        this.message = message;
    }


    public TimeBankException(String message) {
        this.code = 500;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }
}
